package com.hk.login;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hk.action.Action;
import com.hk.action.ActionForward;
import com.hk.dtos.AdminDto;
import com.hk.service.LoginService;

public class UpdateAction implements Action{

	
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		
		
		ActionForward forword=new ActionForward();

		LoginService ls = LoginService.getInstance();
		
		String m1 = request.getParameter("topmenu1");
		String m2 = request.getParameter("topmenu2");
		String m3 = request.getParameter("topmenu3");
		String m4 = request.getParameter("topmenu4");
		String m5 = request.getParameter("topmenu5");
		
		String[] m={m1,m2,m3,m4,m5};
		
		
		System.out.println(m1);
		
		for (int i = 0; i < m.length; i++) {
			AdminDto ad = new AdminDto();
			ad.setName(m[i]);
			ad.setSeq(i+1);
			ls.update(ad);	
		}
		
		
		
		
		
		
		
		forword.setUrl("index");	
		forword.setRedirect(false);
		
		
		
		
		
		return forword;
	
	}
}
